package com.AJava1710D.bingfabao.countdoen;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.CountDownLatch;

/**
 * 作者: LCG
 * 日期: 2020/6/23 11:31
 * 描述:
 */

@RestController
public class TestWeb {

    private static CountDownLatch countDownLatch=new CountDownLatch(4);

    @RequestMapping("student/{A}")
    public String  student(@PathVariable("A") String A){
        System.out.println(A+"===明白了");
        countDownLatch.countDown();
        return A+"===明白了";
    }


    @RequestMapping("teacher")
    public String teacher() throws InterruptedException {
        countDownLatch.await();

        countDownLatch=new CountDownLatch(4);

        return "===好我们进行下一个知识点";

    }

}
